package homework;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Scanner;

public class test {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("note.txt");
        System.out.println("请输入内容（输入 'exit' 退出）：");
        while(true){
            String input = sc.nextLine();
            if("exit".equals(input)){
                break;
            }
            byte[] bytes = input.getBytes();
            fos.write(bytes);

        }
        fos.close();

    }
}
